package com.xtasz.itom.alarm.dao.impl;

import java.util.HashMap;
import java.util.List;

import com.xtasz.itom.alarm.dao.inter.alarmDao;
import com.xtasz.itom.alarm.domain.Alarm;
import com.xtasz.itom.core.BaseDao;
import com.xtasz.itom.util.CustomErrorCodes;
import com.xtasz.itom.util.CustomException;

public class alarmDaoImpl extends BaseDao implements alarmDao {

	@Override
	public List getAlarmProportionInfo(HashMap param) {
		List list = null;
        try {
            list = this.query("getAlarmProportionInfo",param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}

	@Override
	public List getAlarmlist(Alarm alarm) {
		List list = null;
        try {
            list = this.query("getAlarmList",alarm);
           
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}
	@Override
	public List getNegativeAlarmList(Alarm alarm) {
		List list = null;
		try {
			list = this.query("getNegativeAlarmList",alarm);
			
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(new CustomException(
					CustomErrorCodes.CUSTOM_ERROR_CODE, e));
		}
		return list;
	}

	@Override
	public List getSingleAlarm(HashMap param) {
		List list = null;
        try {
        	param.put("DATESUFFIX", CreateTableName());
            list = this.query("getSingleAlarm",param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}
	@Override
	public HashMap getAlarmTopology(HashMap param) {
		HashMap<String,String> map;
        try {
        	param.put("DATESUFFIX", CreateTableName());
        	map=(HashMap<String, String>) this.querySingle("getAlarmTopology", param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return map;
	}

	@Override
	public HashMap getAlarmTopologyInterfaceInfo(HashMap param) {
		HashMap<String,String> map;
        try {
        	param.put("DATESUFFIX", CreateTableName());
        	map=(HashMap<String, String>) this.querySingle("getAlarmTopologyInterfaceInfo", param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return map;
	}
    
	@Override
	public List getInterfaceErrInfo(HashMap param) {
		List list = null;
        try {
        	param.put("DATESUFFIX", CreateTableName());
            list = this.query("getInterfaceErrInfo",param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}
	@Override
	public List getAlarmInterfaceFlag(HashMap param) {
		List list = null;
        try {
        	param.put("DATESUFFIX", CreateTableName());
            list = this.query("getAlarmInterfaceFlag",param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}

	@Override
	public List getFailCodeTop10(HashMap param) {
		List list = null;
        try {
        	param.put("DATESUFFIX", CreateTableName());
            list = this.query("getFailCodeTop10",param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}

	@Override
	public List getInterfaceInfoDetailReg(HashMap param) {
		List list = null;
        try {
        	param.put("DATESUFFIX", CreateTableName());
            list = this.query("getInterfaceInfoDetailReg",param);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(new CustomException(
                    CustomErrorCodes.CUSTOM_ERROR_CODE, e));
        }
        return list;
	}

	
}
